package org.example.transparent;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        System.out.println( "=====================透明组合模式=====================" );
        CoursePackage coursePackage = new CoursePackage("Java架构课程", 1);
        CoursePackage p1 = new CoursePackage("人工智能", 2);
        coursePackage.addChild(p1);
        Course c1 = new Course("NLP", 423D);
        p1.addChild(c1);

        CoursePackage p2 = new CoursePackage("设计模式", 2);
        coursePackage.addChild(p2);
        CoursePackage p3 = new CoursePackage("结构型设计模式", 3);
        p2.addChild(p3);
        Course c2 = new Course("组合模式", 9.9D);
        p3.addChild(c2);
        Course c3 = new Course("享元模式", 9.9D);
        p3.addChild(c3);
        Course c4 = new Course("桥梁模式", 9.9D);
        p3.addChild(c4);

        coursePackage.print();
    }
}
